package com.qunar.wan.common_api.model.enums;

/**
 * User: tongjie.yang Date: 13-11-29 Time: 下午2:14
 */
public enum EmailType {
    NOTICE_FOLLOWER_EMAIL(0, "新活动提醒", "/template/notice_follower_email.vm"), ACTIVITY_EXAMINE_SUCCESS(1, "活动审核成功",
            "/template/activity_examine_success.vm"), ACTIVITY_EXAMINE_FAIL(2, "活动审核失败",
            "/template/activity_examine_fail.vm"), ACTIVITY_START(3, "活动开始提醒", "/template/activity_start.vm"), ACTIVITY_END(
            4, "活动评价邀请", "/template/activity_end.vm");

    private EmailType(int code, String subject, String vmPath) {
        this.code = code;
        this.subject = subject;
        this.vmPath = vmPath;
    }

    private int code;
    private String subject;
    private String vmPath;

    public String getSubject() {
        return subject;
    }

    public String getVmPath() {
        return vmPath;
    }

    public int code() {
        return code;
    }

    public static EmailType codeOf(int code) {
        for (EmailType emailType : values()) {
            if (emailType.code == code) {
                return emailType;
            }
        }
        throw new IllegalArgumentException("Invalid role code: " + code);
    }
}
